package com.morik.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TestJavaScript {
    public static void main(String[] args) {
	Map<String, Name> pn1 = new HashMap<String, Name>();
	pn1.put("Americal", new Name("a1", "a2"));
	pn1.put("Japanese", new Name("j1", "j2"));
	Person peng = new Person(3l, "彭仁夔", Boolean.FALSE, pn1);

	Map<String, Name> wn1 = new HashMap<String, Name>();
	wn1.put("Americal", new Name("a1", "a2"));
	wn1.put("Japanese", new Name("j1", "j2"));
	Person wang = new Person(4l, "王平", Boolean.FALSE, pn1);

	PersonAction pa = new PersonAction();
	/*
         * json={persons:[{id:3,chinaname:'彭仁夔'，birthday：’2008-05-03',sex:1,
         * englishname:[{America:{fname:a1,sname:a2}},
         * {Japanss:{fname:j1,sname:j2}} ] },
         * {id:3,chinaname:'彭仁夔'，birthday：’2008-05-03',sex:1,
         * englishname:[{America:{fname:a1,sname:a2}},
         * {Japanss:{fname:j1,sname:j2}} ] }] }
         */
	List<Person> alist = new ArrayList<Person>();
	alist.add(peng);
	alist.add(wang);
	 pa.setPerson(alist);
	 JsonBuilder jb= new JsonBuilder();
	//JavaScriptBuilder jsb = new JavaScriptBuilder(pa, new Class[] {});
	//System.out.print(jsb.build());
	 System.out.print(new JsonBuilder().build(pa));

    }
}
